<?php defined('SEJUJOPEFDNGJSL') or exit('Access denied');?>
<?php
if(!isset($_GET['templist'])){
	$pbc_price=getprice();
    $btc_price=getprice_btc();
    $ltc_price=getprice_ltc();
    $usd_price=getprice_rate();
  
?>
    <?php require("topbut.php") ?>
    <div class="panel panel-inverse">
        <div class="panel-heading">
            <div class="row">
                <div class="col-md-12">
                    <h4 class="panel-title" style="float: left;">添加钱包地址</h4>
                    <a href="<?php echo $GLOBALARR['curl']?>&templist=1" style="color: #fff;float: right;">钱包管理</a>
                </div>
            </div>
        </div>
        <div class="panel-body">
            <form action="control.php" method="post" onsubmit="return chkzhuancoin111()"  class="form-horizontal">
                <input type="hidden" name="act" value="qianbao" />
                <input type="hidden" name="sprice" value="<?php echo $now_price; ?>" />
                <fieldset style="border:none;">
                     <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">币种名称</label>
                        <div class="col-md-9 ui-sortable">
                            <select class="form-control" name="coin" id="coin">
                                <option value="-1">请选择币种</option>
                                <option value="btc">BTC</option>
                                <option value="ltc">LTC</option>
                                <option value="pbc">VIC</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">钱包标识</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="name" id="name" value="" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">钱包地址</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="addr" id="addr" value="" class="form-control" />
                        </div>
                    </div>
                    <!--<div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">手机短信验证</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="mobile" id="mobile" value="<?php echo $r['phone']?>" class="form-control" readonly="readonly" />
                            <span style="color:red;" id="ztxt"></span>
                            <span style="display:none;" id="did"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">转出电子钱包地址</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="bgy_address" id="bgy_address"  value="" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-3 control-label ui-sortable">验证码</label>
                      <div class="col-md-7 ui-sortable">
                        <input type="text" class="input-text yzmput form-control" name="coded" id="coded" />
                      </div>
                      <div class="col-md-2 ui-sortable">
                        <input type="button" id="btnSendCode" onclick="sendSms()" class="btn btn-md btn-danger" value="发送验证码">
                      </div>
                    </div>-->
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">交易密码</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="password" name="pwd" id="pwd" value="" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-9 col-md-offset-3 ui-sortable">
                            <a href="tradepwd.php">忘记交易密码？</a>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-4 col-md-offset-3 ui-sortable">
                            <button type="submit" class="btn btn-md btn-success m-r-5">提交</button>
                        </div>
                    </div>
                </fieldset>
			</form>
		</div>
	</div>
    <script type="text/javascript" src="/public/home/js/layer/layer.js"></script>
    <script type="text/javascript" src="/public/home/js/jquery.min.js"></script>
	<script type="text/javascript">
    var InterValObj; //timer变量，控制时间
    var count = 60; //间隔函数，1秒执行
    var curCount;//当前剩余秒数
    var btc_price=parseFloat($("#btc_price").html());
    var ltc_price=parseFloat($("#ltc_price").html());
    var pbc_price=parseFloat($("#pbc_price").html());
    var usd_price=parseFloat($("#usd_price").html());
    function sendSms(){
        $.ajaxSetup({
            async: false
        });
        var phone = $("#mobile").val();

         //两者格式都争取情况下可发送手机验证码
         curCount = count;
    　　//设置button效果，开始计时
         $("#btnSendCode").attr("disabled", "true");
         $("#btnSendCode").val("请在" + curCount + "秒内输入验证码");
         InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次

         $.ajax({
            type: "get",
            dataType: "json",
            url: "/plus/sendsms.php?phone="+phone,
            success: function(data){
                layer.alert(data.res);
            },
            error: function(){

            },
            cache: false,
            async: false
         });
    }
    //timer处理函数
    function SetRemainTime() {
        if(curCount == 0){
          window.clearInterval(InterValObj);//停止计时器
          $("#btnSendCode").removeAttr("disabled");//启用按钮
          $("#btnSendCode").val("重新发送验证码");
        }else{
           curCount--;
           $("#btnSendCode").val("请在" + curCount + "秒内输入验证码");
        }
    }
    function chkzhuancoin111(){

        var p2=$.trim($("#name").val());
        var p4=$.trim($("#pwd").val());
        var ztype = $.trim($("#coin").val());
        var addr = $.trim($("#addr").val());
        if(p2==""){
            layer.alert("请输地址名称");
            return false;
        }
        if((!ztype || ztype==-1)){
            layer.alert("请选择币种");
            return false;
        }
        if(addr==""){
            layer.alert("请输入钱包地址");
            return false;
        }
        if(p4==""){
            layer.alert("请输入交易密码");
            return false;
        }
        return true;
    }
    </script>
<?php
}
elseif($_GET['templist']==1){
	$qbtype=array(0=>'锁仓总量',1=>'锁仓收益',2=>'团队收益',3=>' 岗位积分',15=>'BTC',16=>'LTC');
    if(isset($_GET['act'])&&isset($_GET['id'])){
        if($_GET['act']=='del'){
            $ddddd=qianbao_delete($_userid,$_GET['id']);
            echo "<script>alert('删除成功！');location.href='". $GLOBALARR['curl']."&templist=1';</script>";
                exit();
        }
    }
?>
<?php require("topbut.php") ?>
    <div class="panel panel-inverse">
        <div class="panel-heading">
            <div class="row">
                <div class="col-md-12">
                    <h4 class="panel-title" style="float: left;">钱包管理</h4>
                    <a href="home.php?lsact=qianbao" style="color:#fff;float: right;">添加钱包地址</a>
                </div>
            </div>
        </div>
        <div class="panel-body">
			<div class="table-responsive">
				<table class="table table-striped givetable">
				  <tbody>
					<tr>
						<th>序号</th>
                        <th>币种</th>
						<th>钱包标识</th>
						<th>钱包地址</th>
                        <th>添加时间</th>
                        <th>操作</th>
						<!--<th>手续费</th>
                        <th>实际到账个数</th>

						<th>钱包地址</th>
                        <th>兑换状态</th>-->
					</tr>
	<?php
	$records=qianbao_record(0,$_userid,'','','qianbao');
    // var_dump($records);
	$ii=0;
	foreach ($records['arr'] as $k => $v) {
	  $ii++;
	?>
		<tr>
			<td align="center"><?php echo $ii;?></td>
            <td align="center"><?php echo strtoupper($v['coin']);?></td>
			<td align="center"><?php echo $v['name'];?></td>
			<td align="center"><?php echo $v['addr'];?></td>
            <td align="center"><?php echo formatdate($v['ctime'])?></td>

            <td align="center"><a style="outline: none;border-radius: 3px;background:rgb(49,160,230);color: #fff;border: none;padding: 2px 7px;" href="javascript:void()" onclick="deletqb(<?php echo $v['id'];?>)">删除</a></td>

		</tr>
	<?php
	}
	?>
				  </tbody>
                </table>
            </div>
        </div>
	</div>
    <div class="qianbao" style="display:none;">
    <div class="smsbox">

        <div class="smsiptbox">
            <input type="hidden" name="qbid" id="qbid" value="">
            <label>交易密码</label>
            <input type="password" name="pwd" id="pwd" value="" style="width:180px;height:30px;border:1px solid #ccc;font-size: 12px;color:#555;text-indent: 10px;border-radius: 3px;background-color: #eee;"/>
        </div>

        <div class="butbox">
            <input type="button" id="cphone" name="cphone" onclick="deleteqbadd()" value="删除" class="btn btn-success" style="width: 180px;margin-left: 155px;" />
        </div>
        <script type="text/javascript">

        function deleteqbadd(){
            var qbid=$("#qbid").val();
            var pwd=$("#pwd").val();
            if(pwd==''){
                layer.alert("请输入密码!");
                return;
            }
            if(qbid==''){
                layer.alert("未选择!");
                return;
            }
            var status=0;
            $.ajax({
                type: "get",
                dataType: "json",
                url: "ajax.php?act=deleqd&pwd="+pwd+"&qbid="+qbid,
                success: function(data){
                    if(data.status==0){
                        layer.alert(data.tips);
                    }else{
                        layer.alert(data.tips);
                        setTimeout(close,1000);

                    }
                },
                error: function(){
                },
                cache: false,
                async: false
            });

        }
        function close(){
            layer.closeAll();
            location.reload();
        }
    </script>

    </div>
</div>
    <script type="text/javascript">
   function deletqb(id){
       $("#qbid").val(id);
        layer.closeAll();
        layer.open({
            type: 1,
            title: ['删除钱包地址', 'font-size:14px;color:#333;font-weight:900;'],
            skin:"sendbg",
            area: ['518px', '213px'],
            closeBtn: 2,
            shift: 2,
            fix: 0,
            shade: 0,
            anim: 2,
            shadeClose: false,
            content: $('.qianbao'),
            // success: function(layero, index){
            //     layer.style(index, {
            //         top:160
            //     });
            //   }
            offset: ['20px','315px'],
        });
        return false;
    }

</script>
	<?php if(($records['pcount']/$records['pagecount'])>1){ ?>
		<div class="pagediv"><?php echo $records['pagearr'][0]?></div>
	<?php } ?>
	<?php if($records['pcount']==0){ ?>
		<div class="pagediv" style="text-align:center;color:#E47501">--> 暂无数据</div>
	<?php } ?>
<?php
}
elseif($_GET['templist']==2){
    $qbtype=array(0=>'锁仓总量',1=>'锁仓收益',2=>'团队收益',3=>' 岗位积分',15=>'BTC',16=>'LTC');
?>
<?php require("topbut.php") ?>

    <div class="panel panel-inverse">
        <div class="panel-heading">
            <div class="row">
                <div class="col-md-12">
                    <h4 class="panel-title" style="float: left;">转入记录</h4>
                    <a href="home.php?lsact=zhuancoin" style="color:#fff;float: right;">返回</a>
                </div>
            </div>
        </div>
        <div class="panel-body">
            <form action="control.php" method="post" onsubmit="return chkzhuancoin()"  class="form-horizontal">
                <fieldset style="border:none;">
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">账户VIC余额</label>
                        <div class="col-md-7 ui-sortable">
                            <input type="text" name="LTC" id="LTC" value="<?php echo $r['cash_purse']?>" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label ui-sortable">转入钱包地址</label>
                        <div class="col-md-7 ui-sortable">
                            <input class="form-control" type="text" id="xfb_address" name="xfb_address" value="<?php echo $r['xfb_address']; ?>"<?php if($r['xfb_address']){ echo "readonly='readonly'";}?>>
                            <p  style="color: red;">用户申请后，系统会分配唯一且不能修改的接收赞币的地址</p>
                        </div>
                        <div class="col-md-2 ui-sortable">
                            <?php if(empty($r['xfb_address'])){?>
                                <input type="button" id="bask" value="申请赞币钱包地址" onclick="askfor()" class="btn btn-success">
                            <?}?>
                        </div>

                    </div>
                </fieldset>
            </form>
            <form action="control.php" method="post" onsubmit="return chkzhuancoin()"  class="form-horizontal">
                <fieldset style="border:none;">
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">账户LTC余额</label>
                        <div class="col-md-7 ui-sortable">
                            <input type="text" name="LTC" id="LTC" value="<?php echo $r['ltc_account']?>" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label ui-sortable">LTC转入钱包地址</label>
                        <div class="col-md-7 ui-sortable">
                            <input class="form-control" type="text" id="ltc_address" name="ltc_address" value="<?php echo $r['ltc_address']; ?>"<?php if($r['ltc_address']){ echo "readonly='readonly'";}?>>
                            <p  style="color: red;">用户申请后，系统会分配唯一且不能修改的接收LTC的地址</p>
                        </div>
                        <div class="col-md-2 ui-sortable">
                            <?php if(empty($r['ltc_address'])){?>
                                <input type="button" id="ltc_bask" value="申请LTC钱包地址" onclick="askfor_ltc()" class="btn btn-success">
                            <?}?>
                        </div>

                    </div>

                </fieldset>
            </form>
            <form action="control.php" method="post" onsubmit="return chkzhuancoin()"  class="form-horizontal">
                <fieldset style="border:none;">
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">账户BTC余额</label>
                        <div class="col-md-7 ui-sortable">
                            <input type="text" name="LTC" id="LTC" value="<?php echo $r['btc_account']?>" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label ui-sortable">BTC转入钱包地址</label>
                        <div class="col-md-7 ui-sortable">
                            <input class="form-control" type="text" id="btc_address" name="btc_address" value="<?php echo $r['btc_address']; ?>"<?php if($r['btc_address']){ echo "readonly='readonly'";}?>>
                            <p  style="color: red;">用户申请后，系统会分配唯一且不能修改的接收BTC的地址</p>
                        </div>
                        <div class="col-md-2 ui-sortable">
                            <?php if(empty($r['btc_address'])){?>
                                <input type="button" id="btc_bask" value="申请BTC钱包地址" onclick="askfor_btc()" class="btn btn-success">
                            <?}?>
                        </div>

                    </div>
                </fieldset>
            </form>
            <script type="text/javascript">
                function askfor(){
                   // $('#xfb_address').val('gsaiydfQDBLCVSFpdhpcbagfpgfasb');
                   // $('#bask').hide();
                    $.ajax({
                    type: "post",
                    url: "ajax.php?act=getaddress",
                    dataType: "json",
                    data:{"order_no":''},
                    success: function(data){
                        if (data.status) {
                           $('#xfb_address').val(data.mes);
                           $('#bask').hide();
                        } else {
                            layer.alert(data.mes);
                        }
                    },
                    error: function(){}
                });
                }
                function askfor_btc(){
                   // $('#xfb_address').val('gsaiydfQDBLCVSFpdhpcbagfpgfasb');
                   // $('#bask').hide();
                    $.ajax({
                    type: "post",
                    url: "ajax.php?act=getaddress_btc",
                    dataType: "json",
                    data:{"order_no":''},
                    success: function(data){
                        if (data.status) {
                           $('#btc_address').val(data.mes);
                           $('#btc_bask').hide();
                        } else {
                            layer.alert(data.mes);
                        }
                    },
                    error: function(){}
                });
                }
                function askfor_ltc(){
                   // $('#xfb_address').val('gsaiydfQDBLCVSFpdhpcbagfpgfasb');
                   // $('#bask').hide();
                    $.ajax({
                    type: "post",
                    url: "ajax.php?act=getaddress_ltc",
                    dataType: "json",
                    data:{"order_no":''},
                    success: function(data){
                        if (data.status) {
                           $('#ltc_address').val(data.mes);
                           $('#ltc_bask').hide();
                        } else {
                            layer.alert(data.mes);
                        }
                    },
                    error: function(){}
                });
                }
                </script>
            <div class="table-responsive">
                <table class="table table-striped givetable">
                  <tbody>
                    <tr>
                        <th>序号</th>
                        <th>币种</th>
                        <th>兑换类型</th>
                        <th>兑换数量</th>
                        <th>兑换单价</th>
                        <th>总金额</th>
                        <th>兑换时间</th>
                        <!--<th>钱包地址</th>-->
                        <th>txid</th>
                    </tr>
    <?php
    $records=duihuan_record(1,$_userid,'','','zhuancoin');
    $ii=0;
    foreach ($records['arr'] as $k => $v) {
      $ii++;
    ?>
        <tr>
            <td align="center"><?php echo $ii;?></td>
            <td align="center"><?php echo $v['coin'];?></td>
            <td align="center"><?php echo $qbtype[$v['ctype']];?></td>
            <td align="center"><?php echo $v['num'];?></td>
            <td align="center"><?php echo $v['cprice'];?></td>
            <td align="center"><?php echo $v['ctotal'];?></td>
            <td align="center"><?php echo formatdate($v['ctime'])?></td>
            <!--<td align="center"><?php echo $v['caddress'];?></td>-->
            <td align="center"><?php echo $v['txid'];?></td>
        </tr>
    <?php
    }
    ?>
                  </tbody>
                </table>
            </div>
        </div>
    </div>
    <?php if(($records['pcount']/$records['pagecount'])>1){ ?>
        <div class="pagediv"><?php echo $records['pagearr'][0]?></div>
    <?php } ?>
    <?php if($records['pcount']==0){ ?>
        <div class="pagediv" style="text-align:center;color:#E47501">--> 暂无数据</div>
    <?php } ?>
<?php
}
elseif($_GET['templist']==3){
    $now_price=getprice();
    
?>
    <?php require("topbut.php") ?>
    <div class="panel panel-inverse">
        <div class="panel-heading">
            <div class="row">
                <div class="col-md-12">
                    <h4 class="panel-title" style="float: left;">兑换BTC</h4>
                    <a href="<?php echo $GLOBALARR['curl']?>" style="color: #fff;float: right;padding-left: 15px;">兑换VIC</a>
                    <a href="<?php echo $GLOBALARR['curl']?>&templist=4" style="color: #fff;float: right;padding-left: 15px;">兑换LTC</a>&nbsp;&nbsp;&nbsp;
                    <a href="<?php echo $GLOBALARR['curl']?>&templist=1" style="color: #fff;float: right;">兑换记录</a>
                </div>
            </div>
        </div>
        <div class="panel-body">
            <form action="control.php" method="post" onsubmit="return chkzhuancoin()"  class="form-horizontal">
                <div class="table-responsive">
                        <table class="table table-striped givetable" style="display: none;">
                        <?php
                            if($r['out_type']==1){
                                $db->query("select * from ld_out_rule  where out_uid=".$_userid." and out_type=0 order by id asc limit 1",2);
                                $outinfo=$db->rs;
                                if($outinfo){
                                    $sy=$outinfo['out_in_amount']*$outinfo['out_beishu']-$outinfo['out_ti_amount'];
                                     $tishi="此轮收益还剩余".$sy."可以提现！";

                                }else{
                                    $tishi="你已经出局，请重新排单消费！";
                                }
                            }

                        ?>
                            <tr><span style="color:green; float:center;display: none;"><?php echo $tishi;?></span></tr>
                            <tr>
                                <th><span style="color:#dd1c21;">每日可兑上限</span></th>
                                <th><span style="color:#dd1c21;">今日已兑金额</span></th>
                                <th><span style="color:#dd1c21;">当前美业币价格</span></th>
                                <th><span style="color:#dd1c21;">赠送积分</span></th>
                                <th><span style="color:#dd1c21;">奖励积分</span></th>
                                <th><span style="color:#dd1c21;">分享积分</span></th>
                                <th><span style="color:#dd1c21;">岗位积分</span></th>
                                <th><span style="color:#dd1c21;">赠送积分兑换数</span></th>
                                <th><span style="color:#dd1c21;">奖励积分兑换数</span></th>
                                <th><span style="color:#dd1c21;">分享积分兑换数</span></th>
                                <th><span style="color:#dd1c21;">岗位积分兑换数</span></th>
                            </tr>
                            <?php
                    //今天兑换数字加密资产的总金额
                    $tnum=todaydh();
                    $yue=$GLOBALARR['duihuanlimit']-$tnum;
                    if($yue>$r['fuxiao_crash']+$r['fuxiao_jin']){
                        // $bjnum=$r['fuxiao_crash']/1.15/$now_price;
                        $bjnum=($r['fuxiao_crash']+$r['fuxiao_jin'])/$now_price;
                    }else{
                        $bjnum=$yue/$now_price;
                    }
                    if($yue>$r['lixi_crash']){
                        $lxnum=$r['lixi_crash']/$now_price;
                    }else{
                        $lxnum=$yue/$now_price;
                    }
                    if($yue>$r['cash_ldprize']){
                        $ldnum=($r['cash_ldprize'])/$now_price;
                    }else{
                        $ldnum=$yue/$now_price;
                    }
                    if($yue>$r['rise_crash']){
                        $rnum=$r['rise_crash']/$now_price;
                    }else{
                        $rnum=$yue/$now_price;
                    }
                    ?>
                            <tr>
                                <td><span style="color:#dd1c21;">￥<?php echo $GLOBALARR['qkmax']; ?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $tnum;?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $now_price ?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $r['fuxiao_crash']+$r['fuxiao_jin']?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $r['lixi_crash']?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $r['cash_ldprize'];?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $r['rise_crash']?></span></td>
                                <td><span style="color:#dd1c21;"><?php echo floor($bjnum*100)/100;?></span></td>
                                <td><span style="color:#dd1c21;"><?php echo floor($lxnum*100)/100;?></span></td>
                                <td><span style="color:#dd1c21;"><?php echo floor($ldnum*100)/100;?></span></td>
                                <td><span style="color:#dd1c21;"><?php echo floor($rnum*100)/100;?></span></td>
                            </tr>
                        </table>
                    </div>
                <input type="hidden" name="act" value="zhuancoin" />
                <input type="hidden" name="coin" id="coin" value="btc" />
                <input type="hidden" name="sprice" value="<?php echo $now_price; ?>" />
                <fieldset style="border:none;">



                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">账户BTC余额</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="LTC" id="LTC" value="<?php echo $r['btc_account']?>" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">转出BTC的数量</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="num" id="num" value="" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group" style="display:none;">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">支出类型</label>
                        <div class="col-md-9 ui-sortable">
                            <select class="form-control" name="ztype" id="ztype" >
                                <option value="-1">请选择支付类型</option>
                                <option value="1">奖励积分</option>
                                <option value="2">分享积分</option>
                                <option value="3"> 岗位积分</option>
                                <option value="0" style="color:red">赠送积分(退出将不再享受动态积分奖励)</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">手机短信验证</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="mobile" id="mobile" value="<?php echo $r['phone']?>" class="form-control" readonly="readonly" />
                            <span style="color:red;" id="ztxt"></span>
                            <span style="display:none;" id="did"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">转出电子钱包地址</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="bgy_address" id="bgy_address"  value="" class="form-control"  />
                        </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-3 control-label ui-sortable">验证码</label>
                      <div class="col-md-7 ui-sortable">
                        <input type="text" class="input-text yzmput form-control" name="coded" id="coded" />
                      </div>
                      <div class="col-md-2 ui-sortable">
                        <input type="button" id="btnSendCode" onclick="sendSms()" class="btn btn-md btn-danger" value="发送验证码">
                      </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-4 col-md-offset-3 ui-sortable">
                            <button type="submit" class="btn btn-md btn-success m-r-5">提交</button>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
    <script type="text/javascript" src="/public/home/js/layer/layer.js"></script>
    <script type="text/javascript">
    var InterValObj; //timer变量，控制时间
    var count = 60; //间隔函数，1秒执行
    var curCount;//当前剩余秒数
    function sendSms(){
        $.ajaxSetup({
            async: false
        });
        var phone = $("#mobile").val();

         //两者格式都争取情况下可发送手机验证码
         curCount = count;
    　　//设置button效果，开始计时
         $("#btnSendCode").attr("disabled", "true");
         $("#btnSendCode").val("请在" + curCount + "秒内输入验证码");
         InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次

         $.ajax({
            type: "get",
            dataType: "json",
            url: "/plus/sendsms.php?phone="+phone,
            success: function(data){
                layer.alert(data.res);
            },
            error: function(){

            },
            cache: false,
            async: false
         });
    }
    //timer处理函数
    function SetRemainTime() {
        if(curCount == 0){
          window.clearInterval(InterValObj);//停止计时器
          $("#btnSendCode").removeAttr("disabled");//启用按钮
          $("#btnSendCode").val("重新发送验证码");
        }else{
           curCount--;
           $("#btnSendCode").val("请在" + curCount + "秒内输入验证码");
        }
    }
    </script>
<?
}
elseif($_GET['templist']==4){
    $now_price=getprice();
    
?>
    <?php require("topbut.php") ?>
    <div class="panel panel-inverse">
        <div class="panel-heading">
            <div class="row">
                <div class="col-md-12">
                    <h4 class="panel-title" style="float: left;">兑换LTC</h4>
                    <a href="<?php echo $GLOBALARR['curl']?>" style="color: #fff;float: right;padding-left: 15px;">兑换VIC</a>&nbsp;&nbsp;&nbsp;
                    <a href="<?php echo $GLOBALARR['curl']?>&templist=3" style="color: #fff;float: right;padding-left: 15px;">兑换BTC</a>&nbsp;&nbsp;&nbsp;
                    <a href="<?php echo $GLOBALARR['curl']?>&templist=1" style="color: #fff;float: right;">兑换记录</a>
                </div>
            </div>
        </div>
        <div class="panel-body">
            <form action="control.php" method="post" onsubmit="return chkzhuancoin()"  class="form-horizontal">
                <div class="table-responsive">
                        <table class="table table-striped givetable" style="display: none;">
                        <?php
                            if($r['out_type']==1){
                                $db->query("select * from ld_out_rule  where out_uid=".$_userid." and out_type=0 order by id asc limit 1",2);
                                $outinfo=$db->rs;
                                if($outinfo){
                                    $sy=$outinfo['out_in_amount']*$outinfo['out_beishu']-$outinfo['out_ti_amount'];
                                     $tishi="此轮收益还剩余".$sy."可以提现！";

                                }else{
                                    $tishi="你已经出局，请重新排单消费！";
                                }
                            }

                        ?>
                            <tr><span style="color:green; float:center;display: none;"><?php echo $tishi;?></span></tr>
                            <tr>
                                <th><span style="color:#dd1c21;">每日可兑上限</span></th>
                                <th><span style="color:#dd1c21;">今日已兑金额</span></th>
                                <th><span style="color:#dd1c21;">当前美业币价格</span></th>
                                <th><span style="color:#dd1c21;">赠送积分</span></th>
                                <th><span style="color:#dd1c21;">奖励积分</span></th>
                                <th><span style="color:#dd1c21;">分享积分</span></th>
                                <th><span style="color:#dd1c21;">岗位积分</span></th>
                                <th><span style="color:#dd1c21;">赠送积分兑换数</span></th>
                                <th><span style="color:#dd1c21;">奖励积分兑换数</span></th>
                                <th><span style="color:#dd1c21;">分享积分兑换数</span></th>
                                <th><span style="color:#dd1c21;">岗位积分兑换数</span></th>
                            </tr>
                            <?php
                    //今天兑换数字加密资产的总金额
                    $tnum=todaydh();
                    $yue=$GLOBALARR['duihuanlimit']-$tnum;
                    if($yue>$r['fuxiao_crash']+$r['fuxiao_jin']){
                        // $bjnum=$r['fuxiao_crash']/1.15/$now_price;
                        $bjnum=($r['fuxiao_crash']+$r['fuxiao_jin'])/$now_price;
                    }else{
                        $bjnum=$yue/$now_price;
                    }
                    if($yue>$r['lixi_crash']){
                        $lxnum=$r['lixi_crash']/$now_price;
                    }else{
                        $lxnum=$yue/$now_price;
                    }
                    if($yue>$r['cash_ldprize']){
                        $ldnum=($r['cash_ldprize'])/$now_price;
                    }else{
                        $ldnum=$yue/$now_price;
                    }
                    if($yue>$r['rise_crash']){
                        $rnum=$r['rise_crash']/$now_price;
                    }else{
                        $rnum=$yue/$now_price;
                    }
                    ?>
                            <tr>
                                <td><span style="color:#dd1c21;">￥<?php echo $GLOBALARR['qkmax']; ?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $tnum;?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $now_price ?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $r['fuxiao_crash']+$r['fuxiao_jin']?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $r['lixi_crash']?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $r['cash_ldprize'];?></span></td>
                                <td><span style="color:#dd1c21;">￥<?php echo $r['rise_crash']?></span></td>
                                <td><span style="color:#dd1c21;"><?php echo floor($bjnum*100)/100;?></span></td>
                                <td><span style="color:#dd1c21;"><?php echo floor($lxnum*100)/100;?></span></td>
                                <td><span style="color:#dd1c21;"><?php echo floor($ldnum*100)/100;?></span></td>
                                <td><span style="color:#dd1c21;"><?php echo floor($rnum*100)/100;?></span></td>
                            </tr>
                        </table>
                    </div>
                <input type="hidden" name="act" value="zhuancoin" />
                <input type="hidden" name="coin" id="coin" value="ltc" />
                <input type="hidden" name="sprice" value="<?php echo $now_price; ?>" />
                <fieldset style="border:none;">



                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">账户LTC余额</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="LTC" id="LTC" value="<?php echo $r['ltc_account']?>" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">转出LTC的数量</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="num" id="num" value="" class="form-control" />
                        </div>
                    </div>
                    <div class="form-group" style="display:none;">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">支出类型</label>
                        <div class="col-md-9 ui-sortable">
                            <select class="form-control" name="ztype" id="ztype" >
                                <option value="-1">请选择支付类型</option>
                                <option value="1">奖励积分</option>
                                <option value="2">分享积分</option>
                                <option value="3"> 岗位积分</option>
                                <option value="0" style="color:red">赠送积分(退出将不再享受动态积分奖励)</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">手机短信验证</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="mobile" id="mobile" value="<?php echo $r['phone']?>" class="form-control" readonly="readonly" />
                            <span style="color:red;" id="ztxt"></span>
                            <span style="display:none;" id="did"></span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="exampleInputEmail1" class="col-md-3 control-label ui-sortable">转出电子钱包地址</label>
                        <div class="col-md-9 ui-sortable">
                            <input type="text" name="bgy_address" id="bgy_address"  value="" class="form-control"  />
                        </div>
                    </div>
                    <div class="form-group">
                      <label class="col-md-3 control-label ui-sortable">验证码</label>
                      <div class="col-md-7 ui-sortable">
                        <input type="text" class="input-text yzmput form-control" name="coded" id="coded" />
                      </div>
                      <div class="col-md-2 ui-sortable">
                        <input type="button" id="btnSendCode" onclick="sendSms()" class="btn btn-md btn-danger" value="发送验证码">
                      </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-4 col-md-offset-3 ui-sortable">
                            <button type="submit" class="btn btn-md btn-success m-r-5">提交</button>
                        </div>
                    </div>
                </fieldset>
            </form>
        </div>
    </div>
    <script type="text/javascript" src="/public/home/js/layer/layer.js"></script>
    <script type="text/javascript">
    var InterValObj; //timer变量，控制时间
    var count = 60; //间隔函数，1秒执行
    var curCount;//当前剩余秒数
    function sendSms(){
        $.ajaxSetup({
            async: false
        });
        var phone = $("#mobile").val();

         //两者格式都争取情况下可发送手机验证码
         curCount = count;
    　　//设置button效果，开始计时
         $("#btnSendCode").attr("disabled", "true");
         $("#btnSendCode").val("请在" + curCount + "秒内输入验证码");
         InterValObj = window.setInterval(SetRemainTime, 1000); //启动计时器，1秒执行一次

         $.ajax({
            type: "get",
            dataType: "json",
            url: "/plus/sendsms.php?phone="+phone,
            success: function(data){
                layer.alert(data.res);
            },
            error: function(){

            },
            cache: false,
            async: false
         });
    }
    //timer处理函数
    function SetRemainTime() {
        if(curCount == 0){
          window.clearInterval(InterValObj);//停止计时器
          $("#btnSendCode").removeAttr("disabled");//启用按钮
          $("#btnSendCode").val("重新发送验证码");
        }else{
           curCount--;
           $("#btnSendCode").val("请在" + curCount + "秒内输入验证码");
        }
    }
    </script>
<?
}
?>